<template>
	<view>
		<view class="form_list" >
			<view class="list-detail" @click="toPage('/pages/select/department?order_type=11')">
				<view>1、其他入库单
				<span class="grep">{{myconfig.dept_11==undefined?'':myconfig.dept_11.fName}}</span>
				</view>
				<uni-icons type="forward" size="22"></uni-icons>
			</view>
		</view>
		<view class="form_list">
			<view class="list-detail" @click="toPage('/pages/select/department?order_type=12')">
				<view>2、其他出库单
				<span class="grep">{{myconfig.dept_12==undefined?'':myconfig.dept_12.fName}}</span>
				</view>
				<uni-icons type="forward" size="22"></uni-icons>
			</view>
		</view>
		<view class="form_list">
			<view class="list-detail" @click="toPage('/pages/select/department?order_type=18')">
				<view>3、领料单
				<span class="grep">{{myconfig.dept_18==undefined?'':myconfig.dept_18.fName}}</span>
				</view>
				<uni-icons type="forward" size="22"></uni-icons>
			</view>
		</view>
		<view class="form_list">
			<view class="list-detail" @click="toPage('/pages/select/department?order_type=15')">
				<view>4、出库退回单
				<span class="grep">{{myconfig.dept_15==undefined?'':myconfig.dept_15.fName}}</span>
				</view>
				<uni-icons type="forward" size="22"></uni-icons>
			</view>
		</view>
		<view class="form_list">
			<view class="list-detail" @click="toPage('/pages/select/department?order_type=19')">
				<view>5、组装单
				<span class="grep">{{myconfig.dept_19==undefined?'':myconfig.dept_19.fName}}</span>
				</view>
				<uni-icons type="forward" size="22"></uni-icons>
			</view>
		</view>
	</view>
</template>

<script>
// 引入uni-ui组件
import {
  uniIcons
} from "@dcloudio/uni-ui"
export default {
  data() {
    return {
		myconfig: uni.getStorageSync('myconfig'),
    }
  },
  components: {
	uniIcons
  },
  onLoad(){
	  uni.$on('getDepartment',(department)=>{
			this.$set(this.myconfig,'dept_'+department.order_type,department)
			uni.setStorageSync('myconfig',this.myconfig)
	  })
  },
  destroyed() {
  	uni.$off('getDepartment')
  },
  methods: {
    toPage(url){
		uni.showLoading({
			mask:true
		})
		uni.navigateTo({
			url:url,
		})
		uni.hideLoading()
    }
  }
}
</script>
<style lang="less">
</style>